
*********************************************
****   Description   ************************
*********************************************

* This program runs a difference-in-differences model evaluating changes in the content of bank advertising around the Freedman's Savings Bank's charter amendment, generating "Table 7. Changes in the Use of Persuasion Messaging after the 1870 Charter Amendment."  

********************************** 
****   Tests *********************
********************************** 
global cluster cluster(Bank mo_date)


use "$Data/Advertising_BagofWords_December2024.dta", clear 
codebook Year
egen Bank_year=group(Bank Year)
gen FSB_post_race = FSB_race*post 
 

*** 
eststo clear
foreach var of varlist Prescriptions_tfidf  {
	display in red "`var'"
		xi: reghdfe `var' post_FSB nwords , absorb(mo_date  FSB     ) $cluster
		eststo
		xi: reghdfe `var'  post_FSB   nwords  ,  absorb(mo_date FSB    Newspaper)  $cluster  
		eststo	
		xi: reghdfe `var' post_FSB FSB_post_aa FSB_aa  nwords   ,  absorb(mo_date FSB  Newspaper )  $cluster  
		eststo
		xi: reghdfe `var'  post_FSB FSB_post_race FSB_race  nwords  ,  absorb(mo_date FSB  Newspaper )  $cluster  
		eststo

}



foreach var of varlist FalseClaims_tfidf   Sentiment_tfidf {
	display in red "`var'"
		xi: reghdfe `var' post_FSB nwords  , absorb(mo_date FSB  ) $cluster
		eststo
		xi: reghdfe `var' post_FSB  nwords   ,  absorb(mo_date FSB   Newspaper)  $cluster  
		eststo	

}


foreach var of varlist Prescriptions_tfidf FalseClaims_tfidf   Sentiment_tfidf {
	display in red "`var'"
	su `var', d

}
 
esttab, keep( post_FSB FSB_post_aa FSB_post_race )  ///
b(%10.2f) se(%10.2f) ///
starlevels(* .10 ** .05 *** .01) nolegend ///
nonumbers ///
nonotes  depvars ///
stats(  N r2 , fmt( %8.0fc  %8.2f ) )


